<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="../templates/employee_master.xhtml">
            <ui:define name="content">
                <p:panel id="panel" header="New Complaints">
                    <p:messages id="messages"/>
                    <p:panelGrid columns="2">
                        <h:outputText value="Title: "/>
                        <h:outputText id="inputTitle" value="#{complaintsController.selected.title} [#{complaintsController.selected.statusName}]"/>
                        
                        <h:outputText value="Priority: "/>
                        <p:selectOneMenu disabled="true" id="SelectPriority" value="#{complaintsController.selected.priority}">
                            <f:selectItem itemLabel="Low" itemValue="0"/>
                            <f:selectItem itemLabel="Normal"  itemValue="1"/>
                            <f:selectItem itemLabel="High" itemValue="2"/>
                        </p:selectOneMenu>

                        <h:outputText value="Categories: "/>
                        <p:selectOneMenu disabled="true"  id="selectCategory" value="#{complaintsController.selected.categoryID}">
                            <f:selectItems value="#{categoriesController.itemsAvailableSelectOne}" var="cat"
                                           itemLabel="#{cat.label}" itemValue="#{cat.value}" />
                        </p:selectOneMenu>

                        <h:outputText value="Departments: "/>
                        <p:selectOneMenu disabled="true" id="selectDepartment" value="#{complaintsController.selected.departmentID}">
                            <f:selectItems value="#{departmentsController.itemsAvailableSelectOne}" var="i" itemLabel="${i.label}" itemValue="#{i.value}"/>
                        </p:selectOneMenu>
                        
                        <h:outputText value="Description: "/>
                        <h:outputText value="#{complaintsController.selected.description}"/>
                    </p:panelGrid>
                    <f:facet name="footer">
                        <table width="100%">
                            <tr>
                                <td width="30%">
                                   <p:commandButton ajax="false" immediate="true" action="#{complaintsController.prepareList()}" value="List"/> 
                                    <p:commandButton ajax="false" immediate="true" action="#{complaintsController.prepareCreate()}" value="Create"/>
                                </td>
                                <td align="right"> 
                                    
                                </td>
                            </tr>
                        </table>
                       
                    </f:facet>
                </p:panel>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

